package com.simulation.config;

import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class StartupInitializer {

    @EventListener(ApplicationReadyEvent.class)
    public void init() {
        System.out.println("应用启动完成，执行初始化逻辑...");
        loadData();
    }

    private void loadData() {
        System.out.println("加载初始数据...");
        // 这里可以执行数据库加载、缓存初始化等任务
    }

}
